package com.example.zhangwei.widgts.dialog;


import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;

public class androidTVBuilder extends AlertDialog.Builder
{
    private androidTVDialog md;

    private Context context;
    
    public androidTVBuilder(Context context)
    {
        super(context);
        md = new androidTVDialog(context);
        this.context = context;
    }
    
    public androidTVBuilder(Context context, int nType)
    {
        super(context);
        md = new androidTVDialog(context);
        this.context = context;
    }

    public androidTVBuilder setMessage(int messageId)
    {
        md.setMessage(context.getResources().getString(messageId));
        return this;
    }

    public androidTVBuilder setMessage(CharSequence message)
    {
        md.setMessage(message);
        return this;
    }

    public androidTVBuilder setTitle(int titleId)
    {
        md.setTitle(context.getResources().getString(titleId));
        return this;
    }

    public androidTVBuilder setTitle(CharSequence title)
    {
        md.setTitle(title);
        return this;
    }

    public androidTVBuilder setPositiveButton(int textId, OnClickListener listener)
    {
        md.setButton(context.getResources().getString(textId), listener);
        return this;
    }

    public androidTVBuilder setPositiveButton(CharSequence text, OnClickListener listener)
    {
        md.setButton(text, listener);
        return this;
    }

    public androidTVBuilder setNeutralButton(int textId, OnClickListener listener)
    {
        md.setButton2(context.getResources().getString(textId), listener);
        return this;
    }

    public androidTVBuilder setNeutralButton(CharSequence text, OnClickListener listener)
    {
        md.setButton2(text, listener);
        return this;
    }

    public androidTVBuilder setNegativeButton(int textId, OnClickListener listener)
    {
        md.setButton3(context.getResources().getString(textId), listener);
        return this;
    }

    public androidTVBuilder setNegativeButton(CharSequence text, OnClickListener listener)
    {
        md.setButton3(text, listener);
        return this;
    }

    @Override
    public androidTVDialog create()
    {
        return md;
    }
}
